home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freaks Macintosh Archive
/
Freaks Macintosh Archive.bin
/
Freaks Macintosh Archives
/
Textfiles
/
Programmer's Digest 1.0.sit
/
The Programmers Digest™ 1.0.rsrc
/
TEXT_136.txt
< prev
next >
Wrap
Text File
|
1998-11-11
|
6KB
|
105 lines
 
Written by: Alex Blaine
Edited by: ZiffDuck
So you wanna learn HTML, do ya? I will teach you everything you need to
know to get a page up on the internet along with the basic text
manipulation tags in HTML. Later, I will teach you the more advanced
features of HTML. Just as a note, HTML stands for HyperText Markup
Language. First, what are tags? If you have ever looked at the source of
an HTML document, you would have seen a lot of things like <BR>. This is
what we call a tag. Tags ALWAYS start with a "<" and end with a ">".
These tell the browser that what is in between these two signs (< and >) is
a tag and not just plain text. In other words, it says "Hey, don't really
display this, but use it to format the final outcome of my page." Well, it
doesn't really say this, but that is the essence of it. Some tags have
both a starting and an ending tag while others just have a starting tag.
Ending tags always start with "</" and end with ">" with the same text in
between the two that the starting tag has (ex. </B> would be the closing
tag for <B> and </TABLE> would be the ending tag for <TABLE>, ex.2--If you
typed <B>HTML is awesome</B>, HTML is awesome would become bold.) When I
introduce tags that have ending tags, I will call them
"<TAG_NAME></TAG_NAME>" so you will know if they have an ending tag or not.
Tags can also have attributes. If it does, the attributes will go in the
beginning tag (ex. <IMG SRC= "http://website/graphic.gif"> - <IMG> would
be the actual tag, and SRC would be an attribute of it.) Some tags might
have many attributes, and some might not have any. If the tag has an
attribute and you don't add it, it will leave it at the default. Just as
a(nother) note, I use all caps in my tags just as good form and ease of
distinguishing it from normal text. Tags can be in all lower case, as in
"<table>" or in random case, as in "<TaBLe>." There are a lot of tags, but
we will only mention a few in this issue. Now, to start our first HTML
page... Most HTML pages have the framework as follows:
<HTML>
<HEAD>
<TITLE>Title</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
Now, here's an in-depth look at what's going on here: The <HTML></HTML>
tells the browser where the start and stop of the HTML document is. To use
HTML tags, these must be here. The <HEAD></HEAD> tags hold the tags that
go in the the head section of the document (hence the name of the tag.)
In this, we see the <TITLE>Title</TITLE> tags (the title of this page will
be "Title") (note: no quotation marks are required between tags), but
there are other tags that go in the head section of the page. Inside the
<BODY></BODY> tags is where all the action goes on--where you will do all
of your page formatting. Now that you have the framework down, let's start
with the real stuff. Something I need to tell you is that White Space
(returns, spaces [more than one], tabs, etc...) does not matter. I could
have written the framework as:
<HTML><HEAD><TITLE>Title</TITLE></HEAD><BODY></BODY></HTML>
I would have gotten the same effect as the other one, but it wouldn't be
very easy to read. (There is an exception to this--the <PRE></PRE> tags,
which we will talk about later) Now, lets go head-first into the good
stuff. There are many formatting tags which will be explained to you here.
To simulate a carriage return (in C or C++ it is \n), you would insert the
<BR> tag. That stands for "Line Break." The <P> tag signals a new
paragraph. It inserts a line break along with some vertical space. If you
need two (or more) spaces in a row, you would type  . This is more of
an escape sequence than a tag, but since we were on the topic of
formatting, I thought I would throw it in. If you have an unreasonable
number of spaces (like 15), you might want to use the <PRE></PRE> tags.
You would put 15 spaces in between the two tags. It would save time,
space, and your fingers for that matter. Text manipulating will be the
next subject that I cover here. There are many tags to change the way text
looks. To make it bold, you would use the <B></B> tags. Italics would be
indicated by the <I></I> tags. Underlined text would be the <U></U> tags.
The <S></S> tags would make strike-through text. If you wanted your page
to show an actual HTML tag (like you wanted "<FRAMESET>" to appear in the
middle of the page), you would use the <CODE></CODE> tags. Be sure to
close this, because if you don't, it will be the last tag that the browser
recognizes on that page. <TT></TT> would make the text appear in a
"Typewriter" font. The <EM></EM> tags are used to give text Emphasis. To
make the text a size larger, you would use the <BIG></BIG> tags, where as
if you wanted to make it smaller, you would use the <SMALL></SMALL> tags.
To make some text have the maximum emphasis, you would use the
<STRONG></STRONG> tags. <SUB></SUB> tags make the enclosed text
subscripted. The <SUP></SUP> tags make it superscripted. To indicate a
distinctive citation, you would use the <CITE></CITE> tags. If you had a
defined term, they might be marked by the <DFN></DFN> tags. Sample in-line
text would be inside the <SAMP></SAMP> tags. The last tag that will be
shown today is the <XMP></XMP> tags. They render text in a fixed width
font. You can experiment with these different tags on your own and create
different outcomes. Before your next lesson, I would suggest using these
for fun to gain a better understanding of them. You can just create a
plain text document called "something.html" and open it in your browser to
see how it turned out. If you make a change to your document source, just
save the changes and click reload in your browser window. Well, until next
time, have fun with what I have taught you today.
For a general overview of HTML, go to:
http://www.geocities.com/athens/2040
and use what you have learned there. I will eventually cover all of the
topics you see there, but when it fits in.